import request from '@/utils/request'

// 获取列表
export function getList(token, data) {
  return request({
    url: 'access/push/get_list',
    method: 'post',
    params: { token },
    data
  })
}

// 添加
export function addInfo(token, data) {
  return request({
    url: 'access/config/add',
    method: 'post',
    params: { token },
    data
  })
}

// 删除
export function deleteInfo(token, data) {
  return request({
    url: 'access/config/delete',
    method: 'post',
    params: { token },
    data
  })
}
// 删除
export function deletePushInfo(token, data) {
  return request({
    url: 'access/push/delete',
    method: 'post',
    params: { token },
    data
  })
}

// 修改
export function editInfo(token, data) {
  return request({
    url: 'access/config/edit',
    method: 'post',
    params: { token },
    data
  })
}

// 获取单条数据
export function getInfo(token, data) {
  return request({
    url: 'access/config/info',
    method: 'post',
    params: { token },
    data
  })
}
// 获取时区列表和当前时区
export function get_time_zone_list_and_current(token) {
  return request({
    url: 'access/config/get_time_zone_list_and_current',
    method: 'post',
    params: { token }
  })
}
// 设置当前时区
export function set_time_zone(token, data) {
  return request({
    url: 'access/config/set_time_zone',
    method: 'post',
    params: { token },
    data
  })
}
// 推送
export function editPush(token, data) {
  return request({
    url: 'access/push/edit ',
    method: 'post',
    params: { token },
    data
  })
}
// 打开服务器
export function openServer(token, data) {
  return request({
    url: 'access/service/openServer',
    method: 'post',
    params: { token },
    data
  })
}
// 打开扫描
export function openScan(token, data) {
  return request({
    url: 'access/service/openScan',
    method: 'post',
    params: { token },
    data
  })
}

// 批量删除
export function deleteBatch(token, data) {
  return request({
    url: 'access/service/deleteBySn',
    method: 'post',
    params: { token },
    data
  })
}
// 批量推送
export function pushBatch(token, data) {
  return request({
    url: 'access/service/pushDevice',
    method: 'post',
    params: { token },
    data
  })
}
// 批量上传
export function uploadBatch(token, data) {
  return request({
    url: 'access/service/pushPerson',
    method: 'post',
    params: { token },
    data
  })
}
// 批量删除人员信息
export function deletePersonBatch(token, data) {
  return request({
    url: 'access/service/deleteDeviceAll',
    method: 'post',
    params: { token },
    data
  })
}
// 批量设备重启
export function rebootBatch(token, data) {
  return request({
    url: 'access/service/rebootDevice',
    method: 'post',
    params: { token },
    data
  })
}
// 批量OTA升级
export function OTAUpdateBatch(token, data) {
  return request({
    url: '/access/service/update',
    method: 'post',
    params: { token },
    data
  })
}
